package com.mf.all.entity.req;

import com.mf.all.groups.AddGroupsInterface;
import com.mf.all.groups.UpdateGroupsInterface;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalTime;

/**
 * @Author: lmf
 * @Create: 2025/3/8 21:30
 * Description:  任务新增，编辑
 */
@Data
public class TaskReq {
    @Schema(description = "id")
    @NotNull(message = "id不能为空",groups = UpdateGroupsInterface.class)
    private Integer id;

    @Schema(description = "任务名称")
    @NotBlank(message = "任务名称不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private String taskName;

    @Schema(description = "负责人id")
    @NotNull(message = "负责人id不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private String principalId;

    @NotNull(message = "执行人id不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private String executorId;

    @Schema(description = "计划开始时间")
    @NotNull(message = "计划开始时间不能为空", groups = {AddGroupsInterface.class, UpdateGroupsInterface.class})
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDate planStart;

    @Schema(description = "计划结束时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @NotNull(message = "计划结束时间不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private LocalDate planEnd;

    @Schema(description = "汇报周期 1：每天汇报；3：每周汇报一次; 5：半个月汇报一次；8：一个月汇报一次")
    @NotNull(message = "汇报周期不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private Byte reportingCycle;

    @Schema(description = "汇报截止时间点(超过时间需要通知对方进行汇报)")
    @NotNull(message = "汇报截止时间点(超过时间需要通知对方进行汇报)不能为空", groups = {AddGroupsInterface.class, UpdateGroupsInterface.class})
//    @JsonFormat(pattern = "HH:mm:ss")
    private LocalTime reportTime;



    @Schema(description = "超时没有汇报间隔多久再次进行通知")
    @NotNull(message = "超时没有汇报间隔多久再次进行通知不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private Byte delayNotificationMinute;

    @Schema(description = "通知方式;1:邮箱通知")
    @NotNull(message = "通知方式;1:邮箱通知不能为空",groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
    private String notificationWay;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "父级id")
    private int pid;
}
